<template>
	<view class="">
		<view class="statement box d-jc-sb d-ai-c">
			<view class="" @tap="serviceagreement">
				用户服务协议
			</view>
			<image src="https://xb-street.oss-cn-shanghai.aliyuncs.com/xb-doctor/static/images/mine/tiaozhuan@2x.png" mode=""></image>
		</view>
		
		<view class="btn" @tap='bindLogin'>
			退出
		</view>
	</view>
</template>

<script>
	import {
		mapState,
		mapMutations
	} from 'vuex';
	export default {
		data() {
			return {
				
			}
		},
		computed: mapState(['loginState', 'userInfo']),
		methods: {
			...mapMutations(['logout', 'setUserInfo']),
			bindLogin() {
				let _this = this
				uni.showModal({ 
					title: '退出登录',
					content: '确认退出当前账号？',
					success: function(res) {
						if (res.confirm) {
							_this.logout()
							uni.navigateBack(1)
						} else if (res.cancel) {
							uni.showToast({
								title: '已取消',
								duration: 2000,
								icon: "none"
							})
						}
					}
				});
			
				// this.getUserInfo()
			},
			serviceagreement(){
				uni.navigateTo({
					url:'serviceagreement',
					animationDuration:500
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	.statement{
		width: 690rpx;
		height: 120rpx;
		padding: 0 30rpx;
		background-color: #FFFFFF;
		border-bottom: 2rpx solid #F2F7FF;
		view{
			font-size: 32rpx;
			font-weight: 500;
			color: #333333;
		}
		image{
			width: 28rpx;
			height: 28rpx;
		}
	}
.btn{
	width: 690rpx;
	height: 100rpx;
	background: #FF8338;
	border-radius: 50rpx;
	font-size: 32rpx;
	font-weight: bold;
	color: #FFFFFF;
	line-height: 100rpx;
	text-align: center;
	position: absolute;
	bottom: 100rpx;
	left: 30rpx;
}
</style>
